<?php
/*
Template Name: Members Index
*/
?>
<?php get_header(); ?>

<?php
	global $post;
	$args = array(
		'numberposts' => 1000,
		'order' => 'ASC',
		'orderby' => 'title',
		'post_type' => 'post',
		'post_status' => 'publish');
	$post_array = get_posts($args);
	$count=1;
  	$ulClosed=false;
  	$totalPosts= count($post_array);
  	$rowNumbers= ceil($totalPosts/3);

?>
    <div class='container_12 page-container'> 
		<div class="page-inner-div">
			<h2 class='h2-banner'><span><?php the_title(); ?></span></h2>
			<div class="page-contain">
			<?php
			 $colCount=1;
			foreach($post_array as $post) {
				if($count == 1){
					if($colCount == 1) echo "<div class='grid_4 alpha'><ul class='member-list-col'>";
					else if($colCount == 3) echo "<div class='grid_4 omega'><ul class='member-list-col'>";
					else echo "<div class='grid_4'><ul class='member-list-col'>";
  				}	
  					echo "<li class='eachMember'><a href='".get_permalink()."' title='".get_the_title()."'>" .get_the_title()."</a></li>\n";
  					if($count == $rowNumbers){
						echo '</ul></div><!-- end section -->';
						$ulClosed = true;
						$colCount++;
						$count = 1;
					}
					else{
						$ulClosed = false;
						$count++;
					}
  			}
  			if(!$ulClosed) {echo '</ul></div><!-- end section -->';}					
			?>	
			</div><!-- end page-contain -->
    	</div><!-- end page-container -->
    </div>
    <div class="clear"></div>    
<?php get_footer(); ?>    
